/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.designPatterns.adapter;

/**
 *
 * @author minga
 */
public class TemperatureObjectReport implements TemperatureInfo{
     CelciusReport celciusreport;
    public TemperatureObjectReport()
    {
        celciusreport = new CelciusReport();
    }
    @Override
    public double getTemperatureInf() {
        return  cToF(celciusreport.getTemperature());
    }

    @Override
    public void setTemperatureInf(double temperatureInf) {
        celciusreport.setTemperature(fToC(temperatureInf));
    }

    @Override
    public double getTemperatureInc() {
        return celciusreport.getTemperature();
    }

    @Override
    public void setTemperatureInc(double temperatureInf) {
       celciusreport.setTemperature(temperatureInf); 
    }
    private double fToC(double f)
    {
        return ((f-32)*5/9);
    }
    private double cToF(double c)
    {
        return ((c*9/5)+32);
    }
}
